<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <!-- <link rel="stylesheet" type="text/css" href="../css/mzui/css/mzui.min.css" /> -->
    <style>
    	 th{
            text-align: center;
        }
        td{
            text-align: center;
        }
       .infoTop{
	background-color:#d65b5d;
	height:73px;
	/* border-bottom:1px solid #994c00; */
	text-align:center;
	/* border:1px solid red; */	
}
.infoTop a{
	position:absolute;
	height:37px;
	padding:34px 20px 0 20px;
	top:0px;
	left:0px;
	cursor:pointer;	
}
.infoTop img{
	height:25px;
	
}
.infoTop span{
	position:absolute;
	top:24px;
	left:140px;
	font-size:20px;
	height:50px;
	line-height:50px;
	color:#fff;
	cursor:default;	
}
.infoTop .nav{
	float:left;
	width:25px;
	height:25px;
	margin:35px 15px auto 20px;
}
.infoTop .moretype{
	position:absolute;
	top:29px;
	right:15px;
	height:40px;
	width:40px;
	line-height:40px;
	color:#fff;
	cursor:pointer;
	background:url() no-repeat right 10px;
	/*background:url() no-repeat right 10px;*/
	background-size:20px 20px;
}
.addUser{
	height:40px;
	text-align: center;
	font-size:14px;
	border-bottom: 1px solid #d1d0d0;
}
.addUser img{
	float:left;
	margin:9px 10px 0 127px;
	width:22px;
	height:22px;
}
.addUser span{
	float:left;
   height:40px;
   line-height: 40px;
}


body, html {
			margin: 0;
			padding: 0;
			color: #333;
			font-family: "Microsoft YaHei", "Helvetica", sans-serif;
			background-color: #f0f0f0 !important;
		}
		/*  订单列表css  start  */
		.orderbox .bigBG {
			background-color: #fff;
			margin-top: 5px;
		}
		.orderbox .orderNum {
			font-size: 16px;
			line-height: 32px;
			border-bottom: 2px solid #e5e5e5;
			position: relative;
			
		}
		.orderbox .orderNum span {
			display: block;
			color: #666;
			margin: 0 15px;
			/* border:1px solid red; */
		}
		.orderbox .orderNum .delete {
			position: absolute;
			top: 13px;
			right: 15px;
			width: 18px;
			height: 22px;
			cursor: pointer;
			outline: none;
			border: none;
			background: none;
			background-image: url("../../image/order/icon-del1.png");
			background-repeat: no-repeat;
			background-size: 20px 20px;
		}
		.orderbox .orderNum .delete:hover {
			background-image: url("../../image/order/icon-del2.png");
		}
		.orderbox .orderNum .delete:active {
			background-image: url("../../image/order/icon-del2.png");
		}
		
		
		/* 订单删除按钮遮罩层  start */
	.delbg{ 
		display:none; 
		width:100%; 
		height:100%;
		position:fixed;
	 	top:0;
	 	left:0;
	 	z-index:999999;
		background-color:#000; 
		background-color:rgba(0,0,0,0.6);
	}
	 .delbg .show{
		width:280px; 
		height:160px; 
		margin:0 auto;
		margin-top:140px;
		border-radius:4px;
		background-color:#fff; 
		overflow:auto;
	}
	 .delbg .show .showtext{
		margin:0;
		padding:0;
		margin-top:40px;
		font-size:20px;
		line-height:20px;
		color:#333;
		text-align:center;
		/* border:1px solid red; */
	}
	 .delbg .show .btnalign{
		text-align:center;
		margin-top:20px;
		/* border:1px solid red; */
	}
	 .delbg .show .btnclose{
		margin:0;
		padding:0;
		border:none;
		outline:none;
		border-radius:4px;
		width:60px;
		height:30px;
		color:#fff;
		font-family:"微软雅黑";
		font-size:16px;
		cursor:pointer;
		background-color:#ff7f00;
	}
	 .delbg .show .btnsure{
		margin:0;
		padding:0;
		margin-left:32px;
		border:none;
		outline:none;
		text-decoration:none;
		border-radius:4px;
		width:60px;
		height:30px;
		color:#fff;
		font-family:"微软雅黑";
		font-size:16px;
		cursor:pointer;
		background-color:#ff7f00;
	}
	 .delbg .show .btnclose:hover,
	 .delbg .show .btnsure:hover{
		background-color:#e57300;
	}
	 .delbg .show .btnclose:active,
	 .delbg .show .btnsure:active{
		background-color:#f52222;
	}
	/* 订单删除按钮遮罩层  end */
		
	 #pullUp {
		color:#C6C5C5;
	    display:none;
		margin:0px;
		background-color:transparent;
		text-align:center;
	}  

	 .orderbox .orderText p {
		margin: 0 15px;
		color: #999;
		border-bottom: 1px solid #eee;
		font-size: 14px;
		height: 26px;
		line-height: 26px;
			/* border:1px solid red;  */
	}
	 .orderbox .orderText p {
		margin: 0 15px;
		color: #999;
		border-bottom: 1px solid #eee;
		font-size: 14px;
		height: 26px;
		line-height: 26px;
			/* border:1px solid red;  */
	}
	.orderbox .orderbottom {
		height: 36px;
		line-height: 36px;
		border-bottom: 2px solid #e5e5e5;
	}
	.orderbox .orderbottom span {
		margin-left: 15px;
		font-size: 14px;
		color: #999;
	}
	.orderbox .orderbottom input {
		border:1px solid #e5e5e5;
		height:25px;
		weight:75px;
	}
	.orderbox .orderbottom select {
		border:1px solid #e5e5e5;
		height:25px;
	}
	.orderbox .orderbottom button {
		float: right;
		width: 65px;
		height: 28px;
		border-radius: 4px;
		border: none;
		outline: none;
		line-height: 32px;
		font-size: 14px;
		margin-right: 15px;
		margin-top: 4px;
		color: #fff;
		background-color: #2f889a;
		cursor: pointer;
	}
	.orderbox .orderbottom button:hover {
		background-color: #2f889a;
	}
	.orderbox .orderbottom button:active {
		background-color: #2f889a;
	}
	.orderbox .lastP {
		margin: 0;
		padding: 0;
		font-size: 14px;
		line-height: 28px;
		border-bottom: 1px solid #ddd;
		text-align: center;
		cursor: pointer;
	}
	.orderbox .lastP a {
		color: #2f889a;
		font-size: 15px;
		text-decoration: none;
	}
	/*  订单列表css  end  */
	/* 订单页为空时的友情提示css start */
	#hint {
		text-align: center;
	}
	#hint img {
		width: 40px;
		margin-top: 60px;
	}
	#hint p {
		margin: 0;
		padding: 0;
		margin-top: 10px;
		font-size: 14px;
		color: #999;
	}
	/* 订单页为空时的友情提示css end */
	/* 底部nav空白占位 css  */
	.zero{
	display:block;
	height:60px;
	} 
.save-btn{
	position:fixed;
	bottom:0px;
	padding-left:59px;
	padding-right:59px;	
    height:56px;
    width:100%;
    background-color: #FFFFFF;
    display: block;
}
.save-btn #svBtn{
 	display:inline-block;
	height:35px;
	width:242px;
	margin-top:12px;
	border:none;
	background-color:#D65B5D;
	border-radius:10px;
	outline:none;
	color:#fff;
	font-size:16px;
	font-family:"方正兰亭黑简体","Microsoft YaHei";
	line-height:16px;
	text-align:center;
	cursor:pointer;
	text-decoration:none;
} 
.save-btn #svBtn:hover{
	background-color:#d65b5d;
}
.save-btn #svBtn:active{
	background-color:#FFAEB9;
} 
    </style>
</head>
<body>
	
	    <div class="infoTop">
	        <!--<img class="nav" id="openMenu" src=""/>
			--> <a onClick="javascript :api.closeFrame();"><img alt="返回" src="" title="back"></a>  
			<span>试块出库</span>
			<!-- <div class="moretype" onclick="showscanner()"> </div> -->
		</div>
	   <div id="wrapper">
			<ul id="thelist" class="orderbox">
		   <!-- <div class="bigBG">
		         <div class="orderNum">
		           				<span>榜单编号：1234567890353536</span>
		           			</div>
		       				<div class="orderText">
		           				<p>开始时间：&nbsp;2017-01-16 01:02:00</p>	
		           				<p>&nbsp;车&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：&nbsp;胡倩&nbsp;  </p>
		           				<p>货物名称：&nbsp;虚拟制造中心11111111&nbsp;</p>
		           				<p>货物规格：&nbsp;2016-12-20&nbsp;</p>
		           				<p>发货单位：&nbsp;虚拟制造中心11111111&nbsp;</p>
		           				<p>收货单位：&nbsp;虚拟制造中心11111111&nbsp;</p>
		           				<p>&nbsp;毛&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重：&nbsp;虚拟制造中心11111111&nbsp;</p>
		           				<p>&nbsp;皮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重：&nbsp;虚拟制造中心11111111&nbsp;</p>
		           				<p>&nbsp;净&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重：&nbsp;虚拟制造中心11111111&nbsp;</p>
		           				<p>实际净重：&nbsp;虚拟制造中心11111111&nbsp;</p>
		           				<p>&nbsp;数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量：&nbsp;虚拟制造中心11111111&nbsp;</p>
		           				<p>入库数量：&nbsp;虚拟制造中心11111111&nbsp;</p>
		           				<p>未入库数量：&nbsp;虚拟制造中心11111111&nbsp;</p>
		           				
		       				</div>
		       				<div class="orderbottom">
		           				<form id="orderComment" name="orderComment" method="get">
		           				      <span>扣杂数量：</span><input id="number" name="number" type="text" />
		      	     	              
		      	     			 </form>
		           			 </div>
		      	 			   
		       			   </div>
		    			    -->
 			   
 			   
			</ul>
	   </div>
	   <input type="hidden" id="location" name="location"/>
	   <input type="hidden" id="retL"/>
	   <div class="save-btn" id="save-btn">
	        <button type="button" id="svBtn" onclick="saveMaterial()">确认</button>
	   </div> 
</body>
<script type="text/javascript" src="../script/public/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/core/core.js"></script>
<!--<script type="text/javascript" src="../script/mzui/js/mzui.min.js"></script>-->
<script type="text/javascript">
	apiready = function(){		
		var productName=api.pageParam.productName;
	    var castingNum=api.pageParam.castingNum;
	    var blockNumber=api.pageParam.blockNumber;
	    var inventryNum=api.pageParam.inventryNum
	    var objId=api.pageParam.objId;
		//alert(deductionId+"!!!"+deductionNo+"??"+mRNo);
		html=$('#thelist').html();//获取maInfo里的HTML
		html+='<div class="bigBG"><div class="orderNum"><span>试块编号：'+blockNumber
		+'</span></div><div class="orderText">'
		+'<p>&nbsp;铸&nbsp;&nbsp;件&nbsp;号：&nbsp;'+castingNum
		+'&nbsp;</p><p>产品名称：&nbsp;'+productName
		+'&nbsp;</p>'
		
		+'</div><div class="orderbottom"><form id="orderComment" name="orderComment" method="get"><span>出库数量：'
		+'</span><input id="number" name="number" type="text" onblur="checkNum()"/>'
		+'</form></div><div class="orderbottom"><form id="orderComment" name="orderComment" method="get"><span>出库原因：'
		+'</span><select id="reason" name="reason"><option value="">请选择</option><option value="初试" >初试</option><option value="复试" >复试</option><option value="顾客需求" >顾客需求</option></select>'
		+'</form></div></div>'					
      
	   $api.html($api.byId('thelist'), html);
		
		
	//exitApp();
	//右滑打开菜单
		api.addEventListener({
		    name:'swiperight'
		}, function(ret, err){        
		   api.openFrame({
	           name: 'leftMenu',
	           url: 'left_menu.html',
	           rect: {
		           x:0,
		           y:0,
		           w:api.winWidth/2,
		           h:api.winHeight
	           }
           });
		});
	
	//测试--不能触屏
	
	$("#openMenu").click(function(){	
		 api.openFrame({
		           name: 'leftMenu',
		           url: 'left_menu.html',
		           rect: {
			           x:0,
			           y:0,
			           w:api.winWidth/2,
			           h:api.winHeight
		           }
		      });
	    });
	};
//点击确认键函数
function saveMaterial(){
    var productName=api.pageParam.productName;
    var castingNum=api.pageParam.castingNum;
    var blockNumber=api.pageParam.blockNumber;
    var objId=api.pageParam.objId;
    var reason=$("#reason").val();
    var userId=$api.getStorage("user").objId;
    var number=$('#number').val();
   
   if(reason==''){
    	alert("请选择出库原因！");
    	return false;
    }else if(number==''){
    	alert("请输入出库数量！");
    	return false;
    }else{
    var data = {
			reason:reason,
			number:number,
			userId:userId,
			objId:objId
		};
    
    ajaxLocal(data,'blockInventory','saveOutBlock',function(ret,err){
    	//alert("验证成功!!"+JSON.stringify(ret));
    	api.openWin({
            name: 'win_outStorage',
            url: 'win_outStorage.html',
		    reload:true,
            rect: {
                x: 0,
                y: 0,
                w: 'auto',
                h: 'auto'
            }
         });
    	 api.closeFrame({
	           name: 'frm_outStorageForOne'
           });
    });
  }
}	    
function checkNum(){
	var inventryNum=api.pageParam.inventryNum
	var number=$('#number').val();
	if(number*1>inventryNum*1){
	   alert("出库数量请少于"+inventryNum);
	   $('#number').val('');
	   return false;
	}
}	

//查看详情	
 function orderDetail(sendNumber,planId){
 api.openWin({
        name: 'win_allocateDetail',
        url: 'win_allocateDetail.html',
        reload:true,
        pageParam:{
         planId:planId,
         sendNumber:sendNumber
        },
        rect: {
            x: 0,
            y: 0,
            w: 'auto',
            h: 'auto'
        }
    }); 
 }
 
 
</script>
</html>